<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>  
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset=UTF-8>
		<title>活动管理</title>
	    <base href="<%=basePath%>">
		<link rel="stylesheet" type="text/css" href="bootstrap-rs/themes/black/easyui.css">
		<link rel="stylesheet" type="text/css" href="bootstrap-rs/themes/icon.css">
		<link rel="stylesheet" type="text/css" href="bootstrap-rs/demo.css">
		<script type="text/javascript" src="bootstrap-rs/jquery.min.js"></script>
		<script type="text/javascript" src="bootstrap-rs/jquery.easyui.min.js"></script>
		<script type="text/javascript">
			function check(){
				window.location.href="club/activity/check?id=${activity.id}&checkStatus=1";
			}
			
			function checkNotPass(){
				window.location.href="club/activity/check?id=${activity.id}&checkStatus=0";
			}
		
			$(function(){
				$('#dg').datagrid({
			        url:'/club/activity/jsonQueryAll',
			        columns:[[
			        	{field:'ck',checkbox:'true'},
			    		{field:'organizers',title:'组织者',width:100,align:'center'},
			    		{field:'activityDate',title:'活动时间',width:100,align:'center'},
			    		{field:'location',title:'活动地点',width:100,align:'center'},
			    		{field:'content',title:'活动内容',width:100,align:'center'},
			    		{field:'estimatedTotalFees',title:'预计总费用',width:100,align:'center'},
			    		{field:'actualTotalFees',title:'实际总费用',width:100,align:'center'},
			    		{field:'estimatedNumber',title:'预计人数',width:100,align:'center'},
			    		{field:'actualNumber',title:'实际人数',width:100,align:'center'},
			    		{field:'checkStatus',title:'审核状态',width:100,align:'center'}
			        ]],
			        fit:'true',
			        fitColumns:'true',
			        striped:'true',
			        pagination:'true',//是否开启分页
			        pagePosition:'bottom',//分页栏的位置
			        pageNumber:'1',//默认第几页
			        pageSize:'10',//默认每页显示10个
			        pageList:[10,20,30],//每页记录条数的列表
			        singleSelect:'true',
			        checkOnSelect:'true',
			        toolbar: [
			        	{
						iconCls: 'icon-add',
						text:'新增',
						handler: function(){
							//window.location.href="club/activity/toAdd"
							$('#fm').form('clear');
							$('#dlg').dialog('open').dialog('setTitle','新增活动信息');
						}},
			        '-',{
						iconCls: 'icon-edit',
						text:'查看',
						handler: function(){
								var cbs = $('#dg').datagrid('getSelections');
								if(cbs.length==0){
									alert('请选择其中一个活动！');
								}
								window.location.href="club/activity/viewDetail?id="+cbs[0].id;
							}
						},
					'-',{
						iconCls: 'icon-remove',
						text:'编辑',
						handler: function(){
								var cbs = $('#dg').datagrid('getSelections');
								if(cbs.length==0){
									alert('请选择其中一个活动！');
								}
								window.location.href="club/activity/toUpdate?id="+cbs[0].id;						
							}
						},
					'-',{
						iconCls: 'icon-help',
						text:'审核',
						handler: function(){
								var cbs = $('#dg').datagrid('getSelections');
								if(cbs.length==0){
									alert('请选择其中一个活动！');
								}
								window.location.href="club/activity/toCheck?id="+cbs[0].id;						
							}
						},
					'-',{
						iconCls: 'icon-cancel',
						text:'删除',
						handler: function(){
								var cbs = $('#dg').datagrid('getSelections');
								if(cbs.length==0){
									alert('请选择其中一个活动！');
								}else{
									$.messager.confirm('Confirm','确定要删除该活动信息吗？',function(r){
										if(r){
											window.location.href="club/activity/del?id="+cbs[0].id;						
										}
									})
								}
							}
						},
					'-',{
						iconCls: 'icon-cut',
						text:'导出',
						handler: function(){
								var cbs = $('#dg').datagrid('getSelections');
								if(cbs.length==0){
									alert('请选择其中一个活动！');
								}
								window.location.href="club/activity/exportActivityById?id="+cbs[0].id;						
							}
						},
					'-',{
						iconCls: 'icon-save',
						text:'全部导出',
						handler: function(){
								window.location.href="club/activity/exportAllActivities";						
							}
						}
					]
			});
		
		$('#dlg').dialog('open').dialog('setTitle','审核活动信息');
		//结尾
		});
		</script>
		
	</head>
	<body>
<table id="dg" class="easyui-datagrid"></table>
		    <div id="dlg" class="easyui-dialog" style="width:600px;height:480px;padding:10px 20px"
    		closed="true" buttons="#dlg-buttons">
    		<div class="ftitle"></div>
	    		<div class="fitem">
	    			<table>
	    				<tr>
	    					<td>组织者：</td>
	    					<td><input name="organizers" class="easyui-validatebox easyui-textbox" value="${activity.organizers}"></td>
	    				</tr>
	    				<tr>
	    					<td>活动时间：</td>
							<td><input type="text" name="activityDate" value="<fmt:formatDate value="${activity.activityDate}" pattern="yyyy-MM-dd HH:mm:ss"/>"></td>
	    				</tr>
	    				<tr>
							<td>预计广告费：</td>
							<td><input type="text" name="estimatedAdvertisingFee" class="easyui-validatebox easyui-textbox" value="${activity.estimatedAdvertisingFee}">元</td>
						</tr>
						<tr>
							<td>预计材料费：</td>
							<td><input type="text" name="estimatedMaterialFee" class="easyui-validatebox easyui-textbox" value="${activity.estimatedMaterialFee}">元</td>
						</tr>
						<tr>
							<td>预计场地费：</td>
							<td><input type="text" name="estimatedWorkplaceFee" class="easyui-validatebox easyui-textbox" value="${activity.estimatedWorkplaceFee}">元</td>
						</tr>
						<tr>
							<td>预计其它费用：</td>
							<td><input type="text" name="estimatedOthersFee" class="easyui-validatebox easyui-textbox" value="${activity.estimatedOthersFee}">元</td>
						</tr>
						<tr>
							<td>实际广告费：</td>
							<td><input type="text" name="actualAdvertisingFee" class="easyui-validatebox easyui-textbox" value="${activity.actualAdvertisingFee}">元</td>
						</tr>
						<tr>
							<td>实际材料费：</td>
							<td><input type="text" name="actualMaterialFee" class="easyui-validatebox easyui-textbox" value="${activity.actualMaterialFee}">元</td>
						</tr>
						<tr>
							<td>实际场地费用：</td>
							<td><input type="text" name="actualWorkplaceFee" class="easyui-validatebox easyui-textbox" value="${activity.actualWorkplaceFee}">元</td>
						</tr>
						<tr>
							<td>实际其它费用：</td>
							<td><input type="text" name="actualOthersFee" class="easyui-validatebox easyui-textbox" value="${activity.actualOthersFee}">元</td>
						</tr>
						<tr>
							<td>预计人数：</td>
							<td><input type="text" name="estimatedNumber" class="easyui-validatebox easyui-textbox" value="${activity.estimatedNumber}">人</td>
						</tr>
						<tr>
							<td>实际人数：</td>
							<td><input type="text" name="actualNumber" class="easyui-validatebox easyui-textbox" value="${activity.actualNumber}">人</td>
						</tr>								
						<tr>
							<td>活动地点：</td>
							<td><input class="easyui-textbox" data-options="multiline:true" name="location" value="${activity.location}"></td>
						</tr>
						<tr>
							<td>活动内容：</td>
							<td><input class="easyui-textbox" data-options="multiline:true" name="content" value="${activity.content}"></td>
						</tr>
	    			</table>
	    		</div>    			    			    			    			    			    			    		
	    	<div id="dlg-buttons">
	    		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="javascript:check()">审核通过</a>
	    		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:checkNotPass()">审核不通过</a>
			    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-back" onclick="javascript:$('#dlg').dialog('close')">返回上一级</a>
			</div>
		</div> 		
	</body>
</html>
